Chapter 10. Interaction Model Encoding Specification

    1. Overview

      This specification details the encoding of the Interaction Model (IM) in the Matter TLV format.


      Specifically, it details the encoding of the application payload for Matter messages that map to the Interaction Model. The details of the message header are described in Section 4.4, “Message Frame Format” and out of scope of this document.


    2. Messages

      1. Protocol OpCodes

        Each Action in the IM specification SHALL be mapped to a message with a unique Protocol Opcode, namespaced under the PROTOCOL_ID_INTERACTION_MODEL Protocol ID.

        • Vendor ID = 0x0000 (Matter Common)

        • Protocol ID = PROTOCOL_ID_INTERACTION_MODEL


          Protocol Opcode

          Action

          Message

          0x01

          Status Response

          StatusResponseMessage

          0x02

          Read Request

          ReadRequestMessage

          0x03

          Subscribe Request

          SubscribeRequestMessage

          0x04

          Subscribe Response

          SubscribeResponseMessage

          0x05

          Report Data

          ReportDataMessage

          0x06

          Write Request

          WriteRequestMessage

          0x07

          Write Response

          WriteResponseMessage

          0x08

          Invoke Request

          InvokeRequestMessage

          0x09

          Invoke Response

          InvokeRequestMessage

          0x0A

          Timed Request

          TimedRequestMessage


      2. Common Action Information Encoding

        Every action SHALL encode the fields specified in Section 8.2.5.1, “Common Action Information”. The methods for encoding Common Action Information fields are:

        • As a field in the message header

        • As a context tagged field in the action payload


          For every field appearing in TLV-encoded data described by the schemas of the following sections,

          and where a context-specific tag is used, any context-specific tag not listed in a given schema SHALL be reserved for future use and SHALL be silently ignored by clients and servers if seen in a payload.


                1. Message Header Encoded Action Information

                  The following Common Action Information fields are encoded into the message header:


                  Header Field

                  Type

                  Description

                  Message Exchange ID

                  16-bit integer

                  Used to convey the Transaction ID

                  Source Node ID

                  64-bit integer

                  Node ID of the source that generated the transaction

                  Destination ID

                  64-bit integer

                  Either a Node ID or Group ID is encoded in here depending on what the IM indicates

                  Protocol ID

                  32 bits

                  The protocol to which this message belongs; all messages in this spec SHALL use the PROTOCOL_ID_INTERACTION_MODEL

                  Protocol ID

                  Protocol OpCode

                  8 bits

                  The specific message type


                2. Context Tag Encoded Action Information

          The following Common Action Information fields are encoded as context tagged fields in the action message payload. All action messages defined in Section 10.6, “Message Definitions” SHALL include these tagged fields:


          Common Action Field

          Context Tag

          InteractionModelRevision

          0xFF


      3. Chunking

        Chunking is the act of splitting an Action that contains attribute/event data, specifically ReportData and WriteRequest actions, into multiple messages at logical boundaries due to the size limitations imposed by IPv6 for UDP packets (see Section 4.4.4, “Message Size Requirements” for more details).

        Since attribute/event data within Actions are already organized into a series of AttributeDataIBs (for attributes) and EventDataIBs for event records, chunking entails maximally packing these information blocks (IBs) into a series of 'data' messages.

        To ensure in-order delivery of a chunked set of IBs, each data message requires a response before the next data message can be sent. For ReportDataMessage and WriteRequestMessage, a StatusResponseMessage and WriteResponseMessage are the respective response messages.

        A MoreChunkedMessages flag SHALL be set on every data message except the last to convey to the

        receiver possible delivery of more chunked messages within a given Action. This is specified in the WriteRequestMessage and ReportDataMessage.

        While most data types can be easily encoded in this scheme to fit within a message, the fact that lists can be of variable, and arbitrary, length can lead to complications. Specific strategies to encode lists that are chunking friendly are provided in Section 10.5.4.3.1, “Lists”.


      4. Transaction Flows


              1. Read (Success)


                image

                Figure 66. Read message flow


              2. Read (Server Error)


                image

                Figure 67. Read message with server-side error flow


              3. Read (Client Error)

                image


                Figure 68. Read message with client-side error flow


              4. Write (Success)


                image

                Figure 69. Write message flow


              5. Write (Server Error)


                image

                Figure 70. Write message with server-side error flow


              6. Subscribe (Success)

                image


                Figure 71. Subscription flow


              7. Subscribe (Server Error)


                image

                Figure 72. Subscription with server-side error flow


              8. Subscribe (Client Error)

        image


        Figure 73. Subscription with client-side error flow


    3. Data Types

      The IM specification defines a number of schema data types that are usable in a given cluster schema definition.

      This section will outline their encoding onto TLV wire types, and their specific representations.


      Class

      Schema Data Type

      TLV Type

      Analog

      uint8, uint16, uint24, uint32, uint40, uint48, uint56, uint64

      Unsigned Integer (width is selected automatically depending on data value)

      int8, int16, int24, int32, int40, int48, int56, int64

      Signed Integer (width is selected automatically depending on data value)

      float32

      Floating Point Number, 4-byte value

      float64

      Floating Point Number, 8-byte value

      Class

      Schema Data Type

      TLV Type

      Discrete

      enum8, enum16, enum32

      Unsigned Integer (width is selected automatically depending on data value)

      data8, data16, data32, data64

      Unsigned Integer (width is selected automatically depending on data value)

      map8, map16, map32, map64

      Unsigned Integer (width is selected automatically depending on data value)

      boolean

      Boolean

      Composite

      string

      UTF-8 string (length is selected automatically depending on data value)

      octstr

      TLV octet string

      Collection

      list

      TLV array

      struct

      TLV structure


      1. Analog - Integer

        All signed integer schema types SHALL be encoded using the TLV signed integer type. The specific TLV element type (1-byte, 2-byte, 4-byte and 8-byte signed integer types) SHALL be selected automatically at runtime depending on the actual value.

        In this regard, the actual width of the over-the-wire type can be narrower than the width specified in schema.

        E.g. a 32-bit value defined in schema will be encoded to a 1-byte TLV signed integer type if the value doesn’t exceed (-128 to +127).

        Similarly, all unsigned integer schema types SHALL be encoded using the TLV unsigned integer type.


      2. Analog - Floating Point

        Both single and double precision floating point analog schema types SHALL be encoded using equivalent TLV floating point types as well.


      3. Discrete - Enumeration

        Enumerations SHALL be encoded using the TLV unsigned integer type, with the width selected automatically at runtime based on the actual value.

      4. Discrete - Bitmap

        Bitmaps SHALL be encoded using the TLV unsigned integer type, with the width selected automatically at runtime based on the actual value.


      5. Composite - String

        While strings are a derived data type, they SHALL be encoded using the TLV UTF-8 string type.


      6. Composite - Octet String

        Octet strings SHALL be encoded using TLV Byte Strings.


      7. Collection - Struct

        Structure types in schema SHALL be encoded using the TLV structure type.


      8. Collection - List

        The entirety of a list SHALL be encoded as a TLV array. A list index SHALL start at 0.

        Lists shall have a maximum size of 65535 elements (216-1).


      9. Derived Types

        All derived types (with the exception of strings) SHALL be encoded according to their base type.


      10. Field IDs

        Field IDs SHALL be encoded as:


        • A context tag when the MEI prefix encodes a standard/scoped source.

        • A fully-qualified profile-specific tag when the MEI prefix encodes a manufacturer code. The Vendor ID SHALL be set to the manufacturer code, the profile number set to 0 and the tag number set to the MEI suffix.


          image

          NOTE Support for encoding Field IDs with an MC source is provisional.


    4. Sample Cluster

      TODO: Should use discoball cluster instead (see Issue #495).


      This section defines a sample cluster (with attributes, events, and commands) for illustrative purposes; it SHALL NOT be interpreted as a real cluster.

      Sample TLV payloads are provided below. These SHALL conform to the TLV Text Format specification.

      The sample cluster contains a list of user records, each containing information about users (e.g. name, pincode) pertaining to access to a door lock.

      VendorID: Matter (0x0000)

      Cluster: 0x0010

      Name: LockUsersCluster


      1. Schema Types

        UserRecord (struct):


        Field

        Comments

        Schema Type

        ID

        id

        The numerical ID that uniquely identifies a user

        uint64

        0

        name

        The UTF-8 name of the user (for UI purposes)

        string

        1

        pincode

        The unique pincode for the user

        string

        2


        TimeRange (struct):


        Field

        Comments

        Schema Type

        ID

        begin_time

        Beginning time of the range

        uint64

        0

        end_time

        End time of the range

        uint64

        1


      2. Attributes


        Attribute

        Comments

        Schema Type

        ID

        user_records

        The list of user records

        List of UserRecord

        0

        guest_list

        The subset of users that are guests

        List of uint64

        1

        enable_guests

        Whether the guests are allowed at all

        boolean

        2

        max_users_allowed

        The maximum number of users permitted by the server

        uint32

        3

        guest_time_bounds

        Time bounds for access for all guests

        Struct of TimeRange

        4


      3. Commands

        AddUserRequest:

        • Command = 0

        • Empty response


          Argument

          Comments

          Schema Type

          ID

          new_record

          Record to be added

          UserRecord

          0


          UpdateGuestInfoRequest:


        • Command = 1

        • Empty response


          Argument

          Comments

          Schema Type

          ID

          enable_guests

          Whether the guests are allowed at all

          boolean

          1

          max_users_allowed

          The maximum number of users permitted by the server

          uint32

          2

          guest_time_bounds

          Time bounds for access for all guests

          Struct of type TimeRange

          3


          DeleteAllUsersRequest:


        • Command = 2

        • Has no arguments, and an empty response


          Argument

          Comments

          Schema Type

          ID


          FindUserRequest:


        • Command = 3

        • Expects FindUserResponse to be sent back


          Argument

          Comments

          Schema Type

          ID

          id

          ID of user to be found

          uint64

          0


          FindUserResponse:


        • Command = 4


          Argument

          Comments

          Schema Type

          ID

          record

          Record that matches the ID sent in the request

          UserRecord

          0

      4. Events

        UserAddedEvent:


        Event

        Comments

        Schema Type

        ID

        record_added

        The record for the user that was added

        UserRecord

        0


    5. Information Blocks

      These are elements that may apply to multiple message types, and are defined in a common way to permit re-use as a definition. Unless stated otherwise, these correspond to their identically named counterparts in the Interaction Model Specification.


      1. Tag Rules

        Unless otherwise noted, all context tags SHALL be emitted in the order as defined in the appropriate specification. This is done to reduce receiver side complexity in having to deal with arbitrary order tags.


      2. AttributePathIB


        TLV Type: List

        Tag

        Comments

        Tag Type

        Tag Number

        TLV Type

        Range

        EnableTagCompr ession


        Context Tag

        0

        bool

        -

        Node


        Context Tag

        1

        Unsigned Int

        64 bits

        Endpoint


        Context Tag

        2

        Unsigned Int

        16 bits

        Cluster


        Context Tag

        3

        Unsigned Int

        32 bits

        Attribute


        Context Tag

        4

        Unsigned Int

        32 bits

        ListIndex


        Context Tag

        5

        Unsigned Int

        16 bits, nullable

        • The contents of ClusterPathIB in the Interaction Model specification have been expanded here for encoding efficiency.

        • The ClusterPathIB Group field is omitted here (see Node field description).

        • Maximum nesting is restricted to referencing a list element in an attribute. Consequently, the

          NestedPath field is removed and replaced with a single ListIndex field.


                1. EnableTagCompression

                  This tag is used to select between two different interpretations on the receiver when the Node, Endpoint, Cluster, Attribute tags are omitted:

                  • When false or not present, omission of any of the tags in question (with the exception of Node)

                    indicates wildcard semantics.

                  • When true, indicates the use of a tag compression scheme. In this case the value for any omitted tag SHALL be set to the value for that tag in the last AttributePathIB that had EnableTagCompression not present or set to false and was seen in a message that is part of the same interaction model Action as the current message.

                    • The AttributePathIB the values end up coming from MAY appear in the same message (but earlier in it) as the current AttributePathIB.

                    • The values that come from the previous AttributePathIB MAY still be missing. In that case, with the exception of Node, they indicate wildcard semantics.


                2. Node

                  • If the Group field is present in the IM representation, the Group ID is encoded in the DST field in the message header and elided from the encoding here.

                  • The Node tag MAY be omitted if the target node of the path matches the NodeID of the server involved in the interaction.


                3. Endpoint, Cluster

                  • Each of these tags can be omitted. The semantics of such omission depend on the value of

                    EnableTagCompression.


                4. Attribute, ListIndex

                  • When EnableTagCompression is false or not present, they have the following semantics:


                    Attribute

                    ListIndex

                    Description

                    Omitted

                    Omitted

                    Selects all attributes within the specified Node, Endpoint, Cluster

                    Present

                    Omitted

                    Selects a specific attribute within the specified Node, Endpoint, Cluster.

                    Present

                    Present

                    Selects a specific list item within a top-level attribute of type list.


                    This does not allow expressing all possible paths defined in the interaction model. Only paths that can be expressed MAY be used.

                  • The ListIndex tag is nullable. The null value SHALL only be used when this AttributePathIB is used in an AttributeDataIB and indicates a list append operation. See Section 10.5.4.3.1, “Lists” for more details.

                5. Examples

          image

          AttributePath = [[ Endpoint = 10, Cluster = LockUserCluster ]]

          Select all attributes on a given cluster and endpoint:



          image

          Path = [[ Endpoint = 10 ]]

          Select all attributes in all clusters on a given endpoint:



          image

          Path = [[ ]]

          Select all attributes in all clusters on the node:



          image

          Path = [[ Endpoint = 10, Cluster = LockUserCluster, Attribute = enable_guests ]]

          Select a specific attribute:



          image

          Path = [[ Endpoint = 10, Cluster = LockUserCluster, Attribute = user_records, ListIndex = 4 ]]

          Select a specific item in a top-level list:



          image

          Path = [[ Node = 0x18B430003020203, Endpoint = 10 ]]

          Select all attributes in all clusters on a given endpoint on a proxied node:



          image

          Path1 = [[ Node = 0x18B430003020203, Endpoint = 10, Cluster = LockUserCluster, Attribute = user_records, ListIndex = 3 ]] // Start tracking path elements.

          Path2 = [[ EnableTagCompression = true, ListIndex = 4 ]] // Node, Endpoint, Cluster, Attribute are re-used from Path1

          Path3 = [[ EnableTagCompression = true, ListIndex = 5 ]] // Node, Endpoint, Cluster, Attribute are re-used from Path1

          Path4 = [[ EnableTagCompression = true, Attribute = enable_guests ]] // Endpoint, Cluster are re-used from Path1

          Tag Compression Example #1:



          Tag Compression Example #2:


          image

          Path1 = [[ Node = 0x18B430003020203, Cluster = LockUserCluster, Attribute = user_records, ListIndex = 3 ]] // Endpoint is wildcard, start tracking path elements. Path2 = [[ EnableTagCompression = true, ListIndex = 4 ]] // Node, Endpoint (including wildcard), Cluster, Attribute are re-used from Path1

          Path3 = [[ EnableTagCompression = true, ListIndex = 5 ]] // Node, Endpoint (including wildcard), Cluster, Attribute are re-used from Path1

          image

          Path1 = [[ Node = 0x18B430003020203, Endpoint = 10, Cluster = LockUserCluster, Attribute = user_records, ListIndex = 3 ]] // Start tracking path elements.

          Path2 = [[ EnableTagCompression = true, ListIndex = 4 ]] // Node, Endpoint, Cluster, Attribute are re-used from Path1

          Path3 = [[ EnableTagCompression = true, ListIndex = 5 ]] // Node, Endpoint, Cluster, Attribute are re-used from Path1

          Path4 = [[ Node = 0x18B430003020203, Endpoint = 20, Cluster = LockUserCluster, Attribute = enable_guests ]] // Reset tracker variables

          Path5 = [[ EnableTagCompression = true, Attribute = user_records, ListIndex = 5]] // Node, Endpoint, Cluster are re-used from Path4.

          Tag Compression Example #3:



      3. DataVersionFilterIB


        TLV Type: Structure

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        Path


        Context Tag

        0

        ClusterPathIB

        -

        DataVersion


        Context Tag

        1

        Unsigned Int

        32 bits


      4. AttributeDataIB


        TLV Type: Structure

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        DataVersion


        Context Tag

        0

        Unsigned Int

        32 bits

        Path


        Context Tag

        1

        AttributePathI B

        -

        Data


        Context Tag

        2

        Variable (see below)

        -

        • The Change field in the Interaction Model specification is not encoded directly. Instead, it is encoded through the use of special values in the Path and Data fields (see Lists below.


                1. DataVersion

                  This tag can be omitted if the value of EnableTagCompression in the Path field is true. In this case, the value for the omitted tag SHALL be set to the value for that tag (if present) in the last

                  AttributeDataIB that had tag compression disabled (i.e EnableTagCompression not present or set to false) and was seen in a message that is part of the same interaction model Action as the current message. If this tag was not present and tag compression was disabled, it SHALL be interpreted as though a data version was not specified in that, or subsequent AttributeDataIBs.


                2. Path

                  In addition to the rules specified for AttributePathIB, the Attribute and 'Cluster' fields within that element SHALL always be present.


                3. Data

                  Upon path expansion of the value in Path, the hierarchy and structure of the encoded data for each concrete Path SHALL be based on the schema description of the specified attribute within the specified cluster. The TLV encoding of each element in the data SHALL follow the rules of encoding as provided in Data Types.


                  1. Lists


                    The various values in the Change enumeration are realized as follows:


                    Change Type

                    Realization

                    REPLACE

                    Path SHALL refer to a list with ListIndex omitted and Data SHALL contain new values that will replace the existing contents of the list.

                    ADD

                    Path SHALL refer to a list with ListIndex containing a value of null and Data containing the new value of the list item that will be added to the list.

                    DELETE

                    Path SHALL contain a non-null value for

                    ListIndex and Data SHALL contain null.

                    MODIFY

                    Path SHALL contain a non-null value for ListIndex and Data SHALL contain the new value for the existing list item.


                    • A single AttributeDataIB containing a path to the list itself and Data that contains all items in the list encoded as a TLV array. This option SHOULD be selected if it is possible to encode the entirety of the list in a single AttributeDataIB that fits in a single message.

                    • A series of AttributeDataIBs, with the first containing a path to the list itself and Data that is an empty array, which signals clearing the list, and subsequent AttributeDataIBs each containing a path to each list item, in order, and Data that contains the value of the list item. This option SHOULD be selected when it is not possible to encode the entirety of the list in a single AttributeDataIB that fits in a single message.


                4. Examples

                  1. Simple Types


                    image

                    AttributeDataIB = { DataVersion = 1,

                    Path = [[ Endpoint = 10, Cluster = LockUserCluster, FieldID = enable_guests ]] Data = false

                    }

                    Update a top-level attribute:



                5. Collection Types (Struct)

                  image

                  AttributeDataIB = { DataVersion = 1,

                  Path = [[ Endpoint = 10, Cluster = LockUserCluster, FieldID = guest_time_bounds ]] Data = {

                  begin_time = 1000,

                  end_time = 2000

                  }

                  }

                  Update a top-level struct:



                6. Collection Types (List)

          image

          AttributeDataIB = { DataVersion = 1,

          Path = [[ Endpoint = 10, Cluster = LockUserCluster, FieldID = user_records, ListIndex = 1]]

          Data = {

          id = 100,

          name = "Jerry", pincode = "1122"

          }

          }

          Modify a list item:



          Add an item to a list:


          image

          AttributeDataIB = { DataVersion = 1,

          Path = [[ Endpoint = 10, Cluster = LockUserCluster, FieldID = user_records, ListIndex = null]]

          Data = {

          id = 100,

          name = "Jerry", pincode = "1122"

          }

          }

          image

          AttributeDataIB = { DataVersion = 1,

          Path = [[ Endpoint = 10, Cluster = LockUserCluster, FieldID = user_records, ListIndex = 0]]

          Data = null,

          }

          Delete an item in a list:



          image

          AttributeDataIB = { DataVersion = 1,

          Path = [[ Endpoint = 10, Cluster = LockUserCluster, FieldID = user_records]] Data = [[

          {

          id = 100,

          name = "Jerry", pincode = "1122"

          },

          {

          id = 200,

          name = "Noah", pincode = "1222"

          },

          ]]

          }

          Replace a list (Single IB):



          Replace a list (Multiple IBs):


          image

          AttributeDataIB1 = { DataVersion = 1,

          Path = [[ Endpoint = 10, Cluster = LockUserCluster, FieldID = user_records ]] Data = [

          ],

          }


          AttributeDataIB2 = { DataVersion = 1,

          Path = [[ Endpoint = 10, Cluster = LockUserCluster, FieldID = user_records, ListIndex = 0]]

          Data = {

          id = 100,

          name = "Jerry", pincode = "1122"

          }

          }


          AttributeDataIB3 = { DataVersion = 1,

          Path = [[ Endpoint = 10, Cluster = LockUserCluster, FieldID = user_records, ListIndex = 1]]

          Data = {

          id = 200,

          name = "Shelly", pincode = "1332"

          }

          }

      5. AttributeReportIB


        TLV Type: Anonymous Struct

        Element

        Comments

        Tag Type

        Tag Number

        TLV Type

        Range

        AttributeStatu s


        Context Tag

        0

        AttributeStatus IB

        -

        AttributeData


        Context Tag

        1

        AttributeDataI B

        -


      6. EventFilterIB


        TLV Type: Anonymous Struct

        Element

        Comments

        Tag Type

        Tag Number

        TLV Type

        Range

        Node


        Context Tag

        0

        Unsigned Int

        64 bits

        EventMin


        Context Tag

        1

        Unsigned Int

        64 bits

        • The Node tag MAY be omitted if the target node of the path matches the NodeID of the server involved in the interaction.


      7. ClusterPathIB


        TLV Type: List

        Element

        Comments

        Tag Type

        Tag Number

        TLV Type

        Range

        Node


        Context Tag

        0

        Unsigned Int

        64 bits

        Endpoint


        Context Tag

        1

        Unsigned Int

        16 bits

        Cluster


        Context Tag

        2

        Unsigned Int

        32 bits

        • The Node tag MAY be omitted if the target node of the path matches the NodeID of the server involved in the interaction.

        • If the Group field is present, the Group ID is encoded in the DST field in the message header and elided from the encoding here.


      8. EventPathIB


        TLV Type: List

        Element

        Comments

        Tag Type

        Tag Number

        TLV Type

        Range

        Node


        Context Tag

        0

        Unsigned Int

        64 bits

        Endpoint


        Context Tag

        1

        Unsigned Int

        16 bits

        Cluster


        Context Tag

        2

        Unsigned Int

        32 bits

        Event


        Context Tag

        3

        Unsigned Int

        32 bits

        'IsUrgent'


        Context Tag

        4

        Boolean

        -

        • The contents of ClusterPathIB have been expanded here to increase encoding efficiency.

        • The Node tag MAY be omitted if the target node of the path matches the NodeID of the server involved in the interaction.

        • Omission of the Endpoint, Cluster and Event tags SHALL have different interpretations depending on where the EventPathIB is used. See Section 10.6.2.2, “EventRequests”, Section 10.6.4.1, “EventRequests”, and Section 10.6.3.1, “EventReports” for the different contexts.


          10.5.8.1. Examples

          image

          Path = [[ Endpoint = 10, Cluster = LockUserCluster, Event = UserAddedEvent ]]

          Select a particular event type:



          Select all events on a given cluster (used in Read/Subscribe requests):


          image

          Path = [[ Endpoint = 10, Cluster = LockUserCluster ]]

          image

          Path = [[ Endpoint = 10, Cluster = LockUserCluster, IsUrgent = true ]]

          Select all events on a given cluster with urgency (used in Read/Subscribe requests):



      9. EventDataIB


        TLV Type: Structure

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        Path


        Context Tag

        0

        EventPathIB

        -

        EventNumber


        Context Tag

        1

        Unsigned Int

        64 bits

        Priority


        Context Tag

        2

        Unsigned Int

        8 bits

        one-of {






        EpochTimestamp


        Context Tag

        3

        Signed Int

        64 bits

        SystemTimestam p


        Context Tag

        4

        Unsigned Int

        64 bits

        DeltaEpochTime stamp

        Optional

        Context Tag

        5

        Unsigned Int

        64 bits

        DeltaSystemTim estamp

        Optional

        Context Tag

        6

        Unsigned Int

        64 bits

        }






        Data


        Context Tag

        7

        Variable (see below)

        -


              1. DeltaEpochTimestamp

                This tag is present when delta encoding the UTC timestamp relative to a prior event in a given stream of events.

                When this tag is present, all other timestamp tags SHALL be omitted. This SHALL have the same units as EpochTimestamp.

              2. DeltaSystemTimestamp

                This tag is present when delta encoding the System timestamp relative to a prior event in a given stream of events.

                When this tag is present, all other timestamp tags SHALL be omitted.

                This SHALL have the same units as SystemTimestamp.


              3. Data

                This contains the cluster-specific payload of the Event.


                The entirety of the Event is represented as a TLV Structure type.


                The TLV encoding of each field in the event SHALL follow the rules of encoding as provided in Data Types.


              4. Examples

        image

        EventDataElement = {

        Path = [[ Endpoint = 10, Cluster = LockUserCluster, EventID = UserAddedEvent ]], EventNumber = 1001,

        Priority = INFO, EpochTimestamp = 102340234293, Data = {

        record_added = { id = 400,

        name = "Roger", pincode = "9999"

        }

        }

        }

        Single event:



      10. EventReportIB


        TLV Type: Anonymous Struct

        Element

        Comments

        Tag Type

        Tag Number

        TLV Type

        Range

        EventStatus


        Context Tag

        0

        EventStatusIB

        -

        EventData


        Context Tag

        1

        EventDataIB

        -


      11. CommandPathIB


        TLV Type: List

        Element

        Comments

        Tag Type

        Tag Number

        TLV Type

        Range

        Endpoint


        Context Tag

        0

        Unsigned Int

        16 bits

        Cluster


        Context Tag

        1

        Unsigned Int

        32 bits

        Command


        Context Tag

        2

        Unsigned Int

        32 bits

        • The contents of ClusterPathIB have been expanded into the CommandPathIB here to increase encoding efficiency.

        • Wildcarding is achieved by omission of the respective tag.

        • The Node field in the IM representation is the NodeID of the server involved in the interaction. This is omitted in the encoding here since it is retrievable from the message layer for the message containing this element.

        • The Group field in the IM representation is encoded in the DST field in the message header.


          10.5.11.1. Examples

          image

          Path = [[ Endpoint = 10, Cluster = LockUserCluster, Command = AddUserRequest ]]

          Select a particular command:



          image

          Path = [[ Cluster = LockUserCluster, Command = AddUserRequest ]]

          Select a particular command (addressed to a group):



      12. CommandDataIB


        TLV Type: Structure (Anonymous)

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        CommandPath


        Context Tag

        0

        CommandPathI B

        -

        CommandFields


        Context Tag

        1

        variable

        -


              1. CommandFields

                This field SHALL contain the full set of arguments as specified in the description of the command request/response. The arguments SHALL follow the rules of encoding as provided in Data Types.

                The entirety of the arguments SHALL be encapsulated in a TLV structure, with each argument encoded appropriately using its field id as the context tag number.

                If there are no arguments in the Request or Response, this tag MAY be omitted entirely.


              2. Examples

        Request + Response:


        image

        RequestCommandElement = {

        CommandPath = [[ Endpoint = 10, Cluster = LockUserCluster, Command = FindUserRequest ]]

        CommandData = { id = 100

        }

        }


        ResponseCommandElement = {

        CommandPath = [[ Endpoint = 10, Cluster = LockUserCluster, Command = FindUserResponse ]]

        CommandData = { record = {

        id = 100,

        name = "Mary", pincode = "1122"

        }

        }

        }

        image

        RequestCommandElement = {

        CommandPath = [[ Endpoint = 10, Cluster = LockUserCluster, Command = DeleteAllUsersRequest ]]

        }


        ResponseCommandElement = {

        CommandPath = [[ Endpoint = 10, Cluster = LockUserCluster, Command = DeleteAllUsersResponse ]]

        }

        Empty request + Empty response:



      13. InvokeResponseIB


        TLV Type: Structure (Anonymous)

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        Command


        Context Tag

        0

        CommandData IB

        -

        Status


        Context Tag

        1

        CommandStatu sIB

        -


      14. CommandStatusIB


        TLV Type: Structure

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        TLV Type: Structure

        CommandPath


        Context Tag

        0

        CommandPathI B

        -

        Status


        Context Tag

        1

        StatusIB

        -


      15. EventStatusIB


        TLV Type: Structure

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        Path


        Context Tag

        0

        EventPathIB

        -

        Status


        Context Tag

        1

        StatusIB

        -


      16. AttributeStatusIB


        TLV Type: Structure

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        Path


        Context Tag

        0

        AttributePathI B

        -

        Status


        Context Tag

        1

        StatusIB

        -


      17. StatusIB


        TLV Type: Structure

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        Status


        Context Tag

        0

        Unsigned Int

        16 bits

        ClusterStatus


        Context Tag

        1

        Unsigned Int

        16 bits


    6. Message Definitions

      This section contains message definitions that correspond to their equivalent actions in the Interaction Model Specification. Unless specifically indicated, all fields in the ensuing definitions SHALL match their equivalents in the appropriate Actions defined in the Interaction Model Specification.


      1. StatusResponseMessage


        StatusResponseMessage

        TLV Type: Structure (Anonymous)

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        Status


        Context Tag

        0

        Unsigned Int

        32-bits

      2. ReadRequestMessage


        ReadRequestMessage

        TLV Type: Structure (Anonymous)

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        AttributeReque sts

        Optional

        Context Tag

        0

        Array of AttributePathI B

        -

        EventRequests

        Optional

        Context Tag

        1

        Array of EventPathIB

        -

        EventFilters

        Optional

        Context Tag

        2

        Array of EventFilterIB

        -

        FabricFiltered


        Context Tag

        3

        boolean

        -

        DataVersionFil ters

        Optional

        Context Tag

        4

        Array of DataVersionFil terIB

        -


              1. AttributeRequests

                • If not present SHALL be treated as an empty list.


              2. EventRequests

                • If not present SHALL be treated as an empty list.

                • Omission of any of the Endpoint, Cluster, Event tags indicates wildcard semantics.


              3. EventFilters

                • If not present SHALL be treated as an empty list.

                • MAY be ignored (i.e. not decoded) if EventRequests is empty.


              4. DataVersionFilters

                • If not present SHALL be treated as an empty list.

                • MAY be ignored (i.e. not decoded) if AttributeRequests is empty.


      3. ReportDataMessage


        TLV Type: Structure (Anonymous)

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        SubscriptionID

        Optional

        Context Tag

        0

        Unsigned Integer

        32 bits

        TLV Type: Structure (Anonymous)

        AttributeRepor ts

        Optional

        Context Tag

        1

        Array of AttributeRepor tIB


        EventReports

        Optional

        Context Tag

        2

        Array of EventReportIB


        MoreChunkedMes sages

        Can be omitted if false.

        Context Tag

        3

        Boolean

        -

        SuppressRespon se

        Omit if 'false'

        Context Tag

        4

        Boolean

        -


        • Multiple ReportDataMessages MAY be sent if a Report Data action does not fit into a single message.

        • For each ReportDataMessage received, a successful StatusResponse message SHALL be sent back to the sender unless SuppressResponse is true.

        • SuppressResponse SHALL NOT be set to true when either AttributeReports or EventReports are non-empty arrays.


                1. EventReports

                  A list of EventReportIB encoded as a TLV array that have certain compression schemes applied to them to reduce redundant data.

                  For each EventReportIB in the list:


                  • The Path tag SHALL utilize the same tag compression scheme as that utilized by the tags in AttributePathIB. Specifically:

                    • The tag compression scheme SHALL only apply to the Node, Endpoint, Cluster and Event tags within the EventPathIB element.

                    • The first element within the list SHALL specify all the necessary tags and hence serve as the anchor on which subsequent items MAY rely for compression.

                  • The EventNumber MAY be omitted if it is exactly one greater than the EventNumber of the previous Event.

                  • The 'Delta' tags SHALL be used to encode timestamps as deltas from the prior event to improve compression of large timestamps.


                    10.6.3.1.1. Examples


                    Event list (highlighting compressions):


                    image

                    EventReports = [

                    {

                    Path = [[ Endpoint = 10, Cluster = LockUserCluster, EventID = UserAddedEvent ]], ImportanceLevel = INFO,

                    Number = 1001,

                    UTCTimestamp = 102340234293, Data = {

                    record_added = { id = 400,

                    name = "Roger", pincode = "9999"

                    }

                    },

                    },

                    {

                    Path = [[ ]], DeltaUTCTimestamp = 100, Data = {

                    record_added = { id = 300,

                    name = "Scar", pincode = ""8888"

                    }

                    }

                    }

                    {

                    Path = [[ Endpoint = 11, EventID = UserAddedEvent ]], DeltaUTCTimestamp = 1001,

                    Data = {

                    record_added = { id = 800,

                    name = "Beth", pincode = "9999"

                    }

                    }

                    }

                    ]


                2. MoreChunkedMessages

          This flag is set to ‘true’ when there are more chunked messages in a transaction.


      4. SubscribeRequestMessage


        TLV Type: Structure (Anonymous)

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        KeepSubscripti ons


        Context Tag

        0

        Boolean


        TLV Type: Structure (Anonymous)

        MinIntervalFlo or


        Context Tag

        1

        Unsigned Int

        16 bits

        MaxIntervalCei ling


        Context Tag

        2

        Unsigned Int

        16 bits

        AttributeReque sts

        Optional

        Context Tag

        3

        Array of AttributePathI B

        -

        EventRequests

        Optional

        Context Tag

        4

        Array of EventPathIB

        -

        EventFilters

        Optional. Only present if EventRequests is present.

        Context Tag

        5

        Array of EventFilterIB

        -

        FabricFiltered


        Context Tag

        7

        boolean

        -

        DataVersionFil ters

        Optional. Only present if AttributeReque sts is present.

        Context Tag

        8

        Array of DataVersionFil terIB

        -


              1. EventRequests

                • Omission of any of Endpoint, Cluster, Event tags indicates wildcard semantics.


      5. SubscribeResponseMessage

        This is sent after all Reports have been sent back to the client. The sole purpose of this is to convey the final set of parameters for the subscription back to the client.


        SubscribeResponseMessage

        TLV Type: Structure (Anonymous)

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        SubscriptionID


        Context Tag

        0

        Unsigned Int

        32 bits

        MaxInterval


        Context Tag

        2

        Unsigned Int

        16 bits


      6. WriteRequestMessage


        WriteRequestMessage

        TLV Type: Structure (Anonymous)

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        SuppressRespon se

        Omit if ‘false'

        Context Tag

        0

        Boolean

        -

        TimedRequest


        Context Tag

        1

        Boolean

        -

        WriteRequestMessage

        WriteRequests


        Context Tag

        2

        Array of AttributeDataI B


        MoreChunkedMes sages

        Can be omitted if false

        Context Tag

        3

        Boolean

        -


              1. MoreChunkedMessages

                • Like reports, multiple WriteRequestMessages MAY be sent in a single transaction if the set of AttributeDataIBs have to be sent across multiple packets. All but the last message SHALL have the MoreChunkedMessages flag set to true to indicate this situation. Before sending the next WriteRequestMessage, the sender SHALL await the WriteResponseMessage associated with the previous WriteRequestMessage.

                • SuppressResponse SHALL NOT be set to true if MoreChunkedMessages is true.

                • A Write Request action that is part of a Timed Write Interaction SHALL NOT be chunked.


      7. WriteResponseMessage


        WriteResponseMessage

        TLV Type: Structure (Anonymous)

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        WriteResponses


        Context Tag

        0

        Array of AttributeStatus IB

        -


      8. TimedRequestMessage


        TimedRequestMessage

        TLV Type: Structure (Anonymous)

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        Timeout


        Context Tag

        0

        Unsigned Int

        16 bits


      9. InvokeRequestMessage


        InvokeRequestMessage

        TLV Type: Structure (Anonymous)

        Element

        Comments

        Tag Type

        Tag Number

        Type

        Range

        SuppressRespon se


        Context Tag

        0

        Boolean

        -

        TimedRequest


        Context Tag

        1

        Boolean

        -

        InvokeRequestMessage

        InvokeRequests


        Context Tag

        2

        Array of CommandData IB

        -


      10. InvokeResponseMessage


InvokeResponseMessage

TLV Type: Structure (Anonymous)

Element

Comments

Tag Type

Tag Number

Type

Range

SuppressRespon se


Context Tag

0

Boolean

-

InvokeResponse s


Context Tag

1

Array of InvokeRespons eIB

-